package com.bwie.parkdemo.mvvm.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.bwie.lib_core.action.ActActionField;
import com.bwie.lib_core.mvvm.base.BaseActivity;
import com.bwie.parkdemo.BR;
import com.bwie.parkdemo.R;
import com.bwie.parkdemo.databinding.ActivityVisitorvaluesBinding;
import com.bwie.parkdemo.mvvm.viewmodel.VisitorValuesViewModel;

/**
 * 来访预约详情activity
 * */
public class VisitorValuesActivity extends BaseActivity<
        ActivityVisitorvaluesBinding, VisitorValuesViewModel> implements View.OnClickListener {
    @Override
    public int initLayout() {
        return R.layout.activity_visitorvalues;
    }

    @Override
    public void initView() {
        Bundle bundle = getIntent().getBundleExtra(ActActionField.ACTBUNDLE);
        String id = bundle.getString(ActActionField.ACTBUNDLE);
        int applyId = Integer.valueOf("48");
        //将获取到的id数据设置到viewmodel
        vm.setApplyId(applyId);
        vm.setCarNum(bundle.getString("carNum"));
        vm.setData(bundle.getString("start")+"-"+bundle.getString("end"));
        vm.setParKId(bundle.getString("parkId"));
        vm.setTime(bundle.getString("time"));
        TextView tv = findViewById(R.id.layout_title_add);
        tv.setText("修改");
        tv.setVisibility(View.VISIBLE);
        tv.setOnClickListener(this);

    }
    //1167+2378
    @Override
    public int initVariable() {
        return BR.vm;
    }

    @Override
    public void onClick(View v) {
        vm.startAddVisitor();
    }
}
